import { createRouter, createWebHistory } from 'vue-router'
import dmxRoutes from './dmxRouter'
import lxRoutes from './lxRouter'
import bjhRoutes from './bjhRouter'
import dyxRoutes from './dyxRouter'
import ygRoutes from './ygRouter'
import yzpRoutes from './yzpRouter'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: ()=> import('../views/LayoutView.vue'),
      children: [
        {
          path: '/',
          redirect: '/home'
        },
        {
          path: '/home',
          name: 'home',
          component: ()=> import('../views/HomeView.vue')
        },
        {
          path:'/cate',
          name:'cate',
          component: ()=> import('../views/CateView.vue')
        },
        {
          path:'/cart',
          name:'cart',
          component: ()=> import('../views/CartView.vue')
        },
        {
          path:'/mine',
          name:'mine',
          component: ()=> import('../views/MineView.vue')
        }
      ]
    },
    ...dmxRoutes,
    ...lxRoutes,
    ...bjhRoutes,
    ...dyxRoutes,
    ...ygRoutes,
    ...yzpRoutes
  ]
})

export default router
